package net.prasenjit.poc.integration;

import net.prasenjit.poc.integration.model.OnlineBookOrder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.integration.annotation.MessageEndpoint;
import org.springframework.messaging.Message;

/**
 * Created by PPurohit on 12/26/2014.
 */
@MessageEndpoint
public class PostEndpoint {

    final Logger logger = LoggerFactory.getLogger(PostEndpoint.class);

    /**
     * Process a delivery order for sending by mail.
     */
    public void processMessage(Message<OnlineBookOrder> message) {
        OnlineBookOrder order =  message.getPayload();

        logger.debug("In PostEndpoint.  title='{}'  quantity={}  orderType={}  address='{}'",
                new Object[] { order.getTitle(),
                        order.getQuantity(),
                        order.getOrderType(),
                        order.getAddress() });
    }

}
